package com.bolt.report.engine.fill;

import com.bolt.common.collection.IteratorUtil;
import com.bolt.report.definition.HyperlinkDefinition;

import java.util.List;

public class HyperlinkData {

    private List<HyperlinkDefinition> hyperlinkDefinition;

    public HyperlinkData(List<HyperlinkDefinition> hyperlinkDefinition) {
        this.hyperlinkDefinition = hyperlinkDefinition;
    }

    public List<HyperlinkDefinition> getHyperlinkDefinition() {
        return hyperlinkDefinition;
    }

    public void setHyperlinkDefinition(List<HyperlinkDefinition> hyperlinkDefinition) {
        this.hyperlinkDefinition = hyperlinkDefinition;
    }


    public HyperlinkDefinition getSingleDefinition() {
        return this.hyperlinkDefinition.get(0);
    }

    public boolean haveHyperlink() {
        return IteratorUtil.isNotEmpty(this.hyperlinkDefinition);
    }

    public boolean isMultiple() {
        return IteratorUtil.isNotEmpty(this.hyperlinkDefinition) && this.hyperlinkDefinition.size() > 1;
    }

}